{extend name="common/common"/}

{block name="content-header"}
<h1>
    分类目录
    <small>Optional description</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
    <li class="active">Here</li>
</ol>
{/block}

{block name="content"}
<div class="row">
    <div class="col-md-4">

        <div class="nav-tabs-custom-custom nav-tabs-custom-gray">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">添加新分类目录</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab_1">
                    <form method="post" action="{:url( 'insert' )}">
                        <div class="form-group">
                            <label class="">名称</label>
                            <input type="text" name="name" value="" class="form-control">
                            <p class="help-block">这将是它在站点上显示的名字。</p>
                        </div>
                        <!--<div class="form-group">-->
                            <!--<label class="">别名</label>-->
                            <!--<input type="text" name="slug" value="" class="form-control">-->
                            <!--<p class="help-block">“别名”是在URL中使用的别称，它可以令URL更美观。通常使用小写，只能包含字母，数字和连字符（-）。</p>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label class="">父级分类目录</label>
                            <select class="form-control" name="pid" style="width: auto;">
                                <option value="0">无</option>
                                {volist name="p_cates" id="v"}
                                <option value="{$v.id}">{$v.name}</option>
                                {/volist}
                            </select>
                            <p class="help-block">分类目录和标签不同，它可以有层级关系。您可以有一个“音乐”分类目录，在这个目录下可以有叫做“流行”和“古典”的子目录。</p>
                        </div>

                        <div class="form-group">
                            <button type="submit" class="btn btn-primary">添加新分类目录</button>
                        </div>
                    </form>
                </div>
                <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
        </div>

    </div>
    <div class="col-md-8">

        <div class="sub clearfix">
            <div class="pull-left">

            </div>
            <div class="pull-right">
                <form method="get" action="">

                </form>
            </div>
        </div>

        <div class="subsub subsub-top clearfix">
            <div class="pull-left">

            </div>
            <div class="pull-right">
                {$list->total()}个项目
            </div>
        </div>

        <div class="box box-solid box-table">
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th style="width: 2.2em;"><input type="checkbox" class="icheck"></th>
                        <th>名称</th>
                        <!--<th>别名</th>-->

                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>

                        {volist name="list" id='v'}
                            <tr>
                                <td style="width: 2.2em;"><input type="checkbox" class="icheck"></td>
                                <td>{$v['name']}</td>
                                <td>
                                    <a href="{:url('edit', ['id' => $v['id']])}">编辑</a>
                                    <a href="{:url('del', ['id' => $v['id']])}" class="text-red" onclick="return confirm('确定删除？')">删除</a>
                                </td>
                            </tr>
                        {/volist}


                    </tbody>
                    <tfoot>
                    <tr>
                        <th style="width: 2.2em;"><input type="checkbox" class="icheck"></th>
                        <th>名称</th>
                        <!--<th>别名</th>-->
                        <th>总数</th>
                        <th>操作</th>
                    </tr>
                    </tfoot>

                </table>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->

        <div class="subsub subsub-bottom clearfix">
            <div class="pull-left">

            </div>
            <div class="pull-right">
                {$list->total()}个项目
            </div>
        </div>

    </div>
</div>
{/block}